"""
    练习1：定义函数，在类表中找出所有偶数
    [43,43,54,56,76,87,98]
"""

data_list = [43,43,54,56,76,87,98]

def find_even_number():
    for item in data_list:
        if item % 2 == 0:
            yield item

data = find_even_number()
for item in data:
    print(item)

"""
    练习2：定义函数，在列表中找出所有数字
    
"""

data_list1 = [43,"悟空",True,56,"八戒",87.5,98]

def find_number():
    for item1 in data_list1:
        if isinstance(item1,int) or isinstance(item1,float):
            yield item1

data1  = find_number()
for item in data1:
    print(item)